package com.summer.variable;

import java.util.HashMap;
import java.util.Map;

/**
 * Desc:
 * Created by tl on 2018/9/21
 */
public class Constant {
    //用户token的redis前缀
    public static final String TOKEN = "USER_";
    //验证码签名
    public static final String CONTENT_TITLE = "元素钱包";
    //默认密码
    public static final String DEFAULT_PASSWORD= "qwer1234";
    public static final byte BORROW_STATUS_REVIEW_PERSON = 3;
    public static final byte BORROW_STATUS_REVIEW_REJECT = 4;
    public static final byte BORROW_STATUS_REVIEW_PASS = 5;
    public static final byte REPAYMENT_STATUS_PAID = 2;
    public static final byte REPAYMENT_STATUS_PART_PAID = 1;
    public static final byte REPAYMENTDETAIL_STATUS_PAID = 2;
    public static final byte REPAYMENTDETAIL_TYPE_NORMAL = 0;
    public static final byte PAY_TYPE_UNKNOWN = 0;
    public static final byte PAY_TYPE_AUTO = 1;
    public static final byte PAY_TYPE_ONLINE_WX = 2;
    public static final byte PAY_TYPE_ONLINE_BANK = 3;
    public static final byte PAY_TYPE_ONLINE_ZFB = 4;
    public static final byte PAY_TYPE_OFFLINE_WX = 5;
    public static final byte PAY_TYPE_OFFLINE_BANK = 6;
    public static final byte PAY_TYPE_OFFLINE_ZFB = 7;
    public static final byte REPAYMENTDETAIL_TYPE_OVERDUE = 1;
    public static final byte REPAYMENTDETAIL_TYPE_FORWARD = 2;
    public static final byte USER_ZM_AUTHENTIC = 1;
    public static Map<Byte, String> BORROW_STATUS_MAP = new HashMap<>();
    public static Map<Byte, String> PAY_TYPE_MAP = new HashMap<>();
    public static final String RELATIVIZE_TYPE_GXBTB = "GXBTB";
    public static final String RELATIVIZE_TYPE_GXBTBRPT = "GXBTBRPT";
    public static final String RELATIVIZE_TYPE_GXBZM = "GXBZM";
    public static final String RELATIVIZE_TYPE_GXBDEBIT = "GXBDEBIT";
    public static final String REPAYMENT_TYPE_OVERDUE = "逾期待还";
    public static final String REPAYMENT_TYPE_NORMAL = "正常待还";
    public static final String REPAYMENT_TYPE_RENEWAL = "展期待还";
    public static final byte REPAYMENT_TYPE_OFFLINE = 1;
    public static final byte REPAYMENT_TYPE_FORWARD = 1;
    public static final byte COLLECTION_AUDIT_PASS = 2;
    public static final byte COLLECTION_AUDIT_REJECT = 1;
    public static final byte COLLECTION_AUDIT_TODO = 0;
    public static final byte COLLECTION_TYPE_PHONE = 1;
    public static final byte COLLECTION_TYPE_MSG = 2;

    static {
        BORROW_STATUS_MAP.put(BORROW_STATUS_REVIEW_PERSON, "待人工复审");
        BORROW_STATUS_MAP.put(BORROW_STATUS_REVIEW_REJECT, "复审驳回");
        BORROW_STATUS_MAP.put(BORROW_STATUS_REVIEW_PASS, "复审通过");
        PAY_TYPE_MAP.put(PAY_TYPE_UNKNOWN, "未知");
        PAY_TYPE_MAP.put(PAY_TYPE_AUTO, "代扣");
        PAY_TYPE_MAP.put(PAY_TYPE_ONLINE_WX, "微信线上");

        PAY_TYPE_MAP.put(PAY_TYPE_ONLINE_BANK, "银行卡线上");
        PAY_TYPE_MAP.put(PAY_TYPE_ONLINE_ZFB, "支付宝线上");
        PAY_TYPE_MAP.put(PAY_TYPE_OFFLINE_WX, "微信线下");
        PAY_TYPE_MAP.put(PAY_TYPE_OFFLINE_BANK, "银行卡线下");
        PAY_TYPE_MAP.put(PAY_TYPE_OFFLINE_ZFB, "支付宝线下");
    }



    public static final long TOKEN_EXPIRATION_TIME = 7*24*60*60; //token过期时间（单位：秒）
    public static final long PHONE_CAPTCHA_EXPIRATION_TIME = 1800;//手机验证码过期时间
    public static final Integer RESULT_BAD_STATUS = -1; //返回失败的code状态
    public static final byte PHONE_CAPTCHA = 4; //手机验证码4位

    public static final byte PASSWORD_LOWEST = 6; //登录密码最低
    public static final byte PARSSWORD_HIGHEST = 20; //最高20位
    public static final byte USER_STATUS = 0; //用户状态为0时 才可用

    public static final String USER_FORBIDDEN= "用户被禁用";
    public static final String PHONE_IS_ILLEGAL= "手机号不合法";
    public static final String PARAM_IS_NOT_BALANK= "不能为空，或有空格！";
    public static final String PASSWORD_AUTHORITY = "请输入6-20位登录密码";
    public static final String CAPTCHA_AUTHORITY = "请输入4位手机验证码";
    public static final String CAPTCHA_IS_NOT_EXIST = "验证码失效";
    public static final String PHONE_CAPTCHA_SUFFIX = "phoneCaptchaKeySuffix";//Redis获取验证码的key的后缀
    public static final String APP_TOKEN_PREFIX = "App_User";
    public static final String SMS_TIRLE = "元素钱包";//短信发送的标题
    public static final String PHONE_REGULAR = "^((\\+?86)|(\\(\\+86\\)))?(13[0-9][0-9]{8}|14[0-9]{9}|15[0-9][0-9]{8}|17[0-9][0-9]{8}|18[0-9][0-9]{8})$";
}
